package com.yifan.diyFuncion.case1;

import java.util.concurrent.atomic.AtomicReference;

/**
 * @Author YIFan
 * @Date 2023-5-13 14:49
 */
public class FunTest {

    public static void main(String[] args) {

        FuncIfUtil.isTrue(true).throwEx("报错了");



        //执行逻辑
            //isNull如果为空执行Runnable的代码，如果不为空执行consume中的代码，
        //打印
            //不为空
            //执行consume
            //121212
        AtomicReference<String> a = new AtomicReference<>("");
        FuncIfUtil.isNull("121212").isNullHandler(() -> {
            System.out.println("执行Runnable");
            a.set("null");
        }, (consume) -> {
            System.out.println("执行consume");
            a.set(consume.toString());
        });
        System.err.println(a.get());
    }
}
